package dome1;

public class Text {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createBinaryTree();
        System.out.println(binaryTree.isCompleteTree(root));
    }
    public static void main6(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createBinaryTree();
        binaryTree.levelOrder(root);
        System.out.println();
        System.out.println(binaryTree.levelOrder2(root));
    }

    public static void main5(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createBinaryTree();
        BinaryTree.TreeNode node = binaryTree.find(root, 'H');
        System.out.println(node.value);
    }

    public static void main4(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createBinaryTree();
        System.out.println("第K层节点的个数：" + binaryTree.getKLevelNodeCount(root, 3));
        System.out.println("树的高度：" + binaryTree.getHeight(root));
    }

    public static void main3(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createBinaryTree();
        binaryTree.getLeafNodeCount(root);
        System.out.println("叶子的个数：" + binaryTree.leafCount);
        System.out.println("叶子的个数：" + binaryTree.getLeafCount2(root));
    }

    public static void main2(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createBinaryTree();
        binaryTree.getNodeSize(root);
        System.out.println("节点的个数：" + binaryTree.nodeSize);
        System.out.println("节点的个数：" + binaryTree.getNodeSize2(root));
    }

    public static void main1(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createBinaryTree();
        binaryTree.perOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.piostOrder(root);
    }
}
